<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../vue.js"></script>

<body>
  <div id="app">
    <p>{{title}}</p>
    <my-component></my-component>
  </div>
  <template id="tmp1">
    <p>{{title}}</p>
  </template>

  <script>
    Vue.component("my-component", {
      data() {
        return {
          title: "我是组件内的title!",
        }
      },
      template: "#tmp1",
    });
    const vm = new Vue({
      el: "#app",
      data: {
        title: "我是vm实例内的title!"
      }
    });
  </script>
</body>

</html>